package client.jobs;

import client.MapleBuffStat;
import client.MapleCharacter;
import client.PlayerSpecialStats;
import client.PlayerStats;
import client.jobs.job.MapleJob;
import client.jobs.job.MapleJobCode;
import client.skills.Skill;
import client.skills.SkillFactory;
import client.status.MonsterStatus;
import client.status.MonsterStatusEffect;
import constants.JobConstants;
import constants.SkillConstants;
import constants.skills.*;
import handling.channel.handler.AttackInfo;
import handling.world.party.MaplePartyCharacter;
import server.MapleStatEffect;
import server.MapleStatInfo;
import server.life.Element;
import server.life.MapleMonster;
import server.maps.MapleMist;
import tools.*;
import tools.data.input.LittleEndianAccessor;
import tools.packet.ForcePacket;

import java.awt.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Map;
import java.util.Optional;

/**
 * @Author dwang
 * @Description TODO
 * @create 2022/5/24 15:40
 * @Modified By:
 */
public class DeprecateFunction extends JobHandler{

    @Override
    public void parseCloseJobSkip1(AttackInfo ai, LittleEndianAccessor lea, boolean energy) {
        switch (ai.skillId) {
            case 战神.抗压:
            case 唤灵斗师.黑暗闪电:
            case 火毒.快速移动精通:
            case 冰雷.快速移动精通:
            case 主教.快速移动精通:
            case 双刀.阿修罗:
            case 冰雷.寒冰步:
            case 品克缤.品克缤之品格:
                lea.skip(4);
                break;
            default:
                if (SkillConstants.isInflationSkill(ai.skillId) || energy) {
                    lea.skip(4);
                } else {
                    lea.skip(5);
                }
                break;
        }

    }

    @Override
    public void parseCloseAICharge(MapleCharacter chr, AttackInfo ai, LittleEndianAccessor lea, boolean energy, Skill skill) {
        switch (ai.skillId) {
            case 冰雷.闪电矛:
            case 黑骑士.拉曼查之枪:
            case 魂骑士.冥河破:
            case 魂骑士.冥河破_爆破:
            case 侠盗.潜影杀机:
            case 双刀.终极斩:
            case 神炮王.猴子炸药桶:
            case 神炮王.猴子炸药桶_爆炸:
            case 恶魔猎手.恶魔镰刀:
            case 恶魔猎手.灵魂吞噬:
            case 恶魔猎手.恶魔呼吸:
            case 幻影.蓝光连击:
            case 幻影.卡片风暴:
            case 夜光.超级光谱:
            case 夜光.虚空重压:
            case 夜光.晨星坠落:
//            case 狂龙战士.扇击:
//            case 狂龙战士.扇击_1:
//            case 狂龙战士.扇击_变身:
//            case 狂龙战士.扇击_变身_2:
            case 爆莉萌天使.超级诺巴:
            case 爆莉萌天使.灵魂共鸣:
            case 恶魔复仇者.暗影蝙蝠:
            case 恶魔复仇者.活力吞噬:
            case 尖兵.原子推进器:
            case 尖兵.刀锋之舞:
            case 神之子.圆月旋风:
            case 神之子.进阶圆月旋风:
            case 神之子.极速切割_漩涡:
            case 神之子.暴风制动_旋风:
            case 神之子.进阶暴风旋涡_旋涡:
            case 林之灵.生鲜龙卷风:
            case 林之灵.旋风飞行:
            case 隐月.招魂之幕:
            case 隐月.精灵化身:
            case 龙的传人.飞龙在天:
            case 龙的传人.龙魂流星拳:
            case 机械师.集中射击_SPLASH_F:
            case 剑豪.神速无双:
            case 阴阳师.猩猩火酒:
            case 品克缤.骨碌骨碌:
            case 品克缤.飞天跳跳杆:
            case 炎术士.龙奴:
            case 战神.加速终端_恐惧风暴:
            case 战神.加速终端_恐惧风暴_2:
            case 战神.加速终端_恐惧风暴_3:
            case 战神.加速终端_瞄准猎物:
            case 战神.加速终端_瞄准猎物_2:
            case 夜行者.影缝之术:
            case 龙神.龙神_2:
                //case 炎术士.龙奴_最后一击:
                ai.charge = lea.readInt();
                break;
            default:
                ai.charge = !energy && skill != null && skill.isChargeSkill() && ai.skillId != 双刀.阿修罗 && ai.skillId != 尖兵.超能光束炮 && ai.skillId != 船长.子弹盛宴 ? lea.readInt() : 0;
                break;
        }

    }

    @Override
    public void parseCloseJobSkip2(MapleCharacter chr, AttackInfo ai, LittleEndianAccessor lea) {
        int skillid = ai.skillId;
        switch (skillid) {
            case 神之子.极速切割_漩涡:
            case 神之子.暴风制动_旋风:
            case 神之子.进阶暴风旋涡_旋涡:
            case 狂龙战士.扇击:
            case 狂龙战士.扇击_1:
            case 狂龙战士.扇击_变身_2:
            case 恶魔复仇者.暗影蝙蝠:
            case 龙神.雷电俯冲:
            case 龙神.雷电俯冲_攻击:
            case 炎术士.灭绝之焰:
            case 神炮王.猴子炸药桶:
            case 冲锋队长.能量旋风:
            case 冲锋队长.龙卷风拳:
            case 神炮王.猴子炸药桶_爆炸:
            case 夜光.晨星坠落_爆炸:
            case 风灵使者.呼啸暴风:
            case 风灵使者.呼啸暴风_1:
            case 魂骑士.瞬步:
            case 魂骑士.摄魂斩:
            case 魂骑士.月影斩:
            case 魂骑士.月光十字斩:
            case 魂骑士.月光之舞:
            case 魂骑士.月光之舞_空中:
            case 魂骑士.新月斩:
            case 魂骑士.猛袭:
            case 魂骑士.灼影之焰:
            case 魂骑士.光速突击:
            case 魂骑士.日光十字斩:
            case 魂骑士.极速霞光:
            case 魂骑士.极速霞光_空中:
            case 魂骑士.烈日之刺:
            case 箭神.真一击要害箭:
            case 夜行者.双飞斩:
            case 夜行者.四连镖:
            case 夜行者.四连镖_最后一击:
            case 夜行者.暗影大风车:
            case 夜行者.暗影大风车_爆炸:
            case 夜行者.三连环光击破:
            case 夜行者.三连环光击破_最后一击:
            case 夜行者.五倍投掷_爆击率:
            case 夜行者.五倍投掷:
            case 夜行者.五倍投掷_最后一击:
            case 双弩.终结箭:
            case 双弩.爆裂飞腿:
            case 双弩.进阶急袭双杀:
                lea.skip(4);
                break;
            default:
                // 双弩
                if (skillid / 1000 == 23001 || skillid / 1000 == 23101 || skillid / 1000 == 23111 ||
                        skillid / 1000 == 23121) {
                    if (skillid != 双弩.艾琳之怒) {//23121052 双弩的技能除了这个技能都要跳
                        lea.skip(4);
                    }

                    // 品克缤
                } else if (skillid / 1000 == 131001 && skillid != 131001207 && skillid != 131001107) {
                    lea.skip(4);
                }

                //神之子这个地方必需要多1个
                if (JobConstants.is神之子(chr.getJob()) && skillid >= 100000000) {
                    ai.zeroUnk = lea.readByte();
                }
        }
    }

    @Override
    public void parseCloseJobSkip3(MapleCharacter chr, AttackInfo ai, LittleEndianAccessor lea, boolean energy, Skill skill) {
        if (ai.skillId == 豹弩游侠.辅助打猎单元 || ai.skillId == 豹弩游侠.集束箭) {
            lea.skip(4);
        }
        lea.skip(4); //四个00
        if (!energy && lea.readInt() > 0) {
            lea.skip(1);
        }

        switch (ai.skillId) {
            case 冲锋队长.双龙飓风:
                lea.skip(1);
                break;
            case 隐月.招魂之幕:
            case 夜行者.黑暗预兆:
                lea.skip(4);
        }
    }


    /**
     * 获取怪物
     * @param player
     * @param attack
     * @param effect
     */
    @Override
    public int applySkillMobCount(MapleCharacter player, AttackInfo attack, MapleStatEffect effect) {
        int mobCount = effect.getMobCount();
        if (JobConstants.is魂骑士(player.getJob()) && player.getBuffedValue(MapleBuffStat.日月轮转) != null) {
            int b = player.getSpecialStat().getMoonCycle();
            int skillid = b == 0 ? 魂骑士.月光洒落 : 魂骑士.旭日;
            SkillFactory.getSkill(skillid).getEffect(player.getSkillLevel(skillid)).applyTo(player);
        } else if (JobConstants.is神之子(player.getJob())) {
            player.handle提速时刻();
        }
        if (player.getStatForBuff(MapleBuffStat.激素狂飙) != null) {
            mobCount += 5;
        }
        if (player.getTotalSkillLevel(圣骑士.万佛归一破) > 0) {
            mobCount += SkillFactory.getSkill(圣骑士.万佛归一破).getEffect(player.getTotalSkillLevel(圣骑士.万佛归一破)).getTargetPlus();
        }
        return mobCount;
    }

    @Override
    public int getSkillAttackCount(MapleStatEffect effect, MapleCharacter player, AttackInfo attack) {
        Map<MapleStatInfo, Integer> info = effect.getInfo();
        int sourceid = effect.getSourceid();
        int attackCount = info.get(MapleStatInfo.attackCount) + player.getStat().getAttackCount(sourceid);
        if (JobConstants.is箭神(player.getJob())) {
            int addcount = player.getSkillLevel(箭神.天赐神箭) > 0 && effect.getAttackCount() >= 2 ? 1 : 0;
            attackCount += addcount;
        } else if (player.getBuffedIntValue(MapleBuffStat.月光转换) == 1) {
            attackCount *= 2;
        } else if (player.getStatForBuff(MapleBuffStat.光暗转换) != null || player.getStatForBuff(MapleBuffStat.影分身) != null || (player.getStatForBuff(MapleBuffStat.骑兽技能) != null && player.getStatForBuff(MapleBuffStat.骑兽技能).is美洲豹骑士())) {
            attackCount *= 2;
        } else if (player.hasBuffSkill(神炮王.霰弹炮)) {
            attackCount *= 3;
        } else if (player.getStatForBuff(MapleBuffStat.战斗大师) != null || player.getStatForBuff(MapleBuffStat.激素狂飙) != null) {
            attackCount += 2;
        } else if (attack.skillId == 奇袭者.毁灭) {
            attackCount += Math.min(player.getBuffedIntValue(MapleBuffStat.百分比无视防御) / 5, player.getStat().raidenCount); //最大是5次 取最小值
        } else if (player.getStatForBuff(MapleBuffStat.光暗转换) != null) {
            attackCount *= 2;
        } else if (player.getStatForBuff(MapleBuffStat.天使复仇) != null && attack.skillId == 主教.光芒飞箭) {
            attackCount += 5;
        }
        return attackCount;
    }

    /**
     * 处理是否有固定伤害的技能比如圣域
     * @param player
     * @param attack
     * @param monster
     * @param visProjectile
     * @return
     */
    @Override
    public long beforeAttack(MapleCharacter player, AttackInfo attack, MapleMonster monster, int visProjectile) {
        if (JobConstants.is隐士(player.getJob())) {
            boolean isUseSkillEffect = true;
            if (player.isBuffFrom(MapleBuffStat.刺客标记, SkillFactory.getSkill(隐士.刺客标记))) {

                Skill mskill = null;
                int mskillid = 0;
                int mskillevel = 0;
                MapleStatEffect effectSkill = null;

                if (player.getSkillLevel(SkillFactory.getSkill(隐士.刺客标记)) > 0) {
                    mskillid = 隐士.刺客标记;
                    mskill = SkillFactory.getSkill(隐士.刺客标记);
                    mskillevel = player.getSkillLevel(SkillFactory.getSkill(隐士.隐士标记));
                }

                if (player.getSkillLevel(SkillFactory.getSkill(隐士.隐士标记)) > 0) {
                    mskillid = 隐士.隐士标记;
                    mskill = SkillFactory.getSkill(隐士.隐士标记);
                    mskillevel = player.getSkillLevel(SkillFactory.getSkill(隐士.隐士标记));
                }
                for (MonsterStatusEffect s : monster.getAllBuffs()) {
                    //检测该怪物是否存在刺客标记
                    if (s.getSkill() == mskillid) {
                        if (JobConstants.is隐士(player.getJob())) {
                            if (attack.skillId != 0 && attack.skillId != 隐士.刺客标记_飞镖 && attack.skillId != 隐士.隐士标记_飞镖 && visProjectile > 0) {
                                isUseSkillEffect = false;
                                player.handleAssassinStack(monster, visProjectile);
                                //对其怪物取消标记
                                monster.cancelSingleStatus(s);
                                //monster.cancelSingleStatus(new MonsterStatusEffect(MonsterStatus.中毒, effectSkill.getDOT(), mskillid, null, false));
                            }
                        }
                    }
                }

                // 添加刺客标记效果
                if (isUseSkillEffect) {
                    if (mskill != null) {
                        effectSkill = mskill.getEffect(mskillevel);
                    }
                    if (effectSkill != null) {
                        if (attack.skillId != 0 && attack.skillId != 隐士.刺客标记_飞镖 && attack.skillId != 隐士.隐士标记_飞镖 && visProjectile > 0) {
                            if (effectSkill.makeChanceResult()) {
                                monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Poison, effectSkill.getDOT(), mskillid, null, false, effectSkill.getDOTStack()), true, effectSkill.getDuration(), true, effectSkill);
                            }
                        }
                    }
                }
            }
            return 0;
        } else if (JobConstants.is圣骑士(player.getJob()) && specialSkillHandleDamage(attack)) {
            return monster.getStats().isBoss() ? 500000 : (monster.getHp() - 1);
        }
        return 0;
    }

    /**
     * 角色攻击怪物时的HP,MP属性处理，如吸收HP
     *
     * @param player    玩家对象
     * @param monster   怪物对象
     * @param skillid   技能ID
     * @param totDamage 受到的伤害
     */
    @Override
    public void onAttack(final MapleCharacter player, final MapleMonster monster, int skillid, long totDamage, AttackPair oned) {
        final PlayerStats stats = player.getStat();
        final PlayerSpecialStats specialStats = player.getSpecialStat();
        int job = player.getJob();
        int moboid = monster.getObjectId();
        long maxhp = monster.getMobMaxHp();
        Point point = monster.getPosition();
        /*参数传递到当前怪物的伤害*/
        player.setTotDamageToMob(totDamage);

        //------------------------------------------------- 针对职业控制
        //
        //
        Integer value = player.getBuffedValue(MapleBuffStat.生命吸收);
        if (value != null && totDamage > 0) {
            /*使用将给敌人造成的伤害的一部分转化为HP的增益。最多恢复角色最大HP的20%，只有在#c斗气点数在30以上#时才能使用。*/
            /*消耗斗气点数#comboConAran，在#time秒内将伤害的#x%转化为HP*/
            MapleStatEffect effect = player.getStatForBuff(MapleBuffStat.生命吸收);
            double maxhp_per = 50;
            switch (player.getBuffSource(MapleBuffStat.生命吸收)) {
                case 恶魔猎手.吸血鬼之触:
                    int currentdate = Integer.valueOf(DateUtil.getCurrentDate("ddHHmmss"));
                    if (value + effect.getY() > currentdate) {
                        break;
                    } else {
                        maxhp_per = effect.getW();
                        player.getBuffStatValueHolder(MapleBuffStat.生命吸收).value = currentdate;
                    }
                default:
                    player.addHP(((int) Math.min(maxhp, Math.min(((int) ((double) totDamage * (double) effect.getX() / 100.0)), ((double) stats.getMaxHp() / 100.0) * maxhp_per))));
                    break;
            }
        }

        /*攻击时，在短时间内按照一定比率，把给敌人造成的伤害吸收，并生成保护膜。不可叠加，且每次攻击时重新生成保护膜。*/
        /*攻击时，在#time秒内，把对敌人造成的伤害的#y%转换为保护自己的保护膜。保护膜可以吸收所受伤害的#x%，可吸收的最大伤害量为最大体力的#z%*/
        //------------------------------------------------- 针对职业控制 后面职业和技能合并
        //
        //
        if (JobConstants.is箭神(job)) {
            Optional.ofNullable(SkillFactory.getSkill(箭神.伤害置换)).ifPresent(skill -> {
                if (player.getTotalSkillLevel(skill) > 0) {
                    MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(skill));
                    effect.applyTo(player, true);
                }
            });
        } else if (JobConstants.is冒险家法师(job)) {
            // 攻击时，无视怪物6%防御率，除召唤兽攻击以外的攻击命中时，有22%概率在5秒内使伤害提高2%.伤害增加效果最多可累积5次
            int[] skillIds = {火毒.神秘瞄准术, 冰雷.神秘瞄准术, 主教.神秘瞄准术};
            for (int i : skillIds) {
                Skill skill = SkillFactory.getSkill(i);
                if (player.getTotalSkillLevel(skill) > 0) {
                    MapleStatEffect venomEffect = skill.getEffect(player.getTotalSkillLevel(skill));
                    if (venomEffect.makeChanceResult() && player.getAllLinkMid().size() < venomEffect.getY()) {
                        player.setLinkMid(moboid, venomEffect.getX());
                        venomEffect.applyTo(player);
                    }
                    break;
                }
            }
            if (skillid == 冰雷.冰封时代) {
                Optional.ofNullable(SkillFactory.getSkill(冰雷.寒冰之缘)).ifPresent(skill -> {
                    MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(skill));
                    monster.getMap().spawnMist(new MapleMist(effect.calculateBoundingBox(monster.getTruePosition(), player.isFacingLeft()), player, effect, monster.getPosition()), effect.getDuration(), false);
                });
            }
        } else if (player.getBuffSource(MapleBuffStat.守护模式变更) == 林之灵.巨熊模式) {
            Optional.ofNullable(SkillFactory.getSkill(林之灵.拉伊之皮_强化)).ifPresent(skill -> {
                if (player.getTotalSkillLevel(skill) > 0) {
                    MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(skill));
                    if (effect != null && effect.makeChanceResult()) {
                        if (totDamage > 0) {
                            player.addHP(((int) Math.min(maxhp, Math.min(((int) ((double) totDamage * (double) effect.getX() / 100.0)), stats.getMaxHp() / 10))));
                        }
                    }
                }
            });
        } else if (JobConstants.is侠盗(job)) {
            int s = player.getTotalSkillLevel(侠盗.名流爆击) > 0 ? 侠盗.名流爆击 : 侠盗.暴击蓄能;
            Optional.ofNullable(SkillFactory.getSkill(s)).ifPresent(skill -> {
                final MapleStatEffect eff = skill.getEffect(player.getTotalSkillLevel(skill));
                if (player.getTotalSkillLevel(skill) > 0) {
                    int critical = Math.min(100, (eff.getX() + player.getCriticalGrowth()));
                    player.setCriticalGrowth((critical > 0 && critical <= 100) ? critical : 0);
                    eff.applyTo(player);
                }
            });

            /* 在一定时间内攻击敌人时掉落金币。技能等级越高，掉落的金币越多。使用一次会激活，再使用一次就会关闭效果的#cON/OFF技能 */
            if (player.getBuffedValue(MapleBuffStat.敛财术) != null) {
                /* 以下技能在攻击时，将会掉落金币 */
                switch (skillid) {
                    case 0:
                    case 飞侠.二连击:
                    case 侠盗.回旋斩:
                    case 侠盗.炼狱:
                    case 侠盗.刀刃之舞:
                    case 侠盗.突然袭击:
                    case 侠盗.一出双击:
                        int maxmeso = player.getBuffedValue(MapleBuffStat.敛财术);
                        Optional.ofNullable(SkillFactory.getSkill(侠盗.敛财术)).ifPresent(skill1 -> {
                            MapleStatEffect effect = skill1.getEffect(player.getTotalSkillLevel(侠盗.敛财术));
                            for (Pair<Long, Boolean> eachde : oned.attack) {
                                long num = eachde.left;
                                if (player.getStat().pickRate >= 100 || Randomizer.nextInt(99) < player.getStat().pickRate) {
                                    player.getMap().spawnMesoDrop(Math.min((int) Math.max(((double) num / (double) 20000) * maxmeso, 1), maxmeso), new Point((int) (monster.getTruePosition().getX() + Randomizer.nextInt(100) - 50), (int) (monster.getTruePosition().getY())), monster, player, false, (byte) 0);
                                    player.setBuffedValue(MapleBuffStat.敛财术, Math.min(effect.getY(), player.getBuffedIntValue(MapleBuffStat.敛财术) + 1));
                                    effect.applyTo(player, true);
                                }
                            }
                        });
                        break;
                }
            }

            player.handleKillSpreeGain();

        } else if (JobConstants.is恶魔猎手(job)) {
            player.handleForceGain(moboid, skillid);
        } else if (JobConstants.is夜行者(job)) {
            //存在影子蝙蝠技能Buff时才触法该效果
            if (player.getBuffedValue(MapleBuffStat.影子蝙蝠) != null) {
                if (skillid == 夜行者.双飞斩 || skillid == 夜行者.三连环光击破 || skillid == 夜行者.四连镖 || skillid == 夜行者.五倍投掷) {
                    player.handle影子蝙蝠(moboid);
                    //这里处理攻击蝙蝠分裂目标!!!
                    player.handle影子分裂(moboid, point);
                }
            }
        } else if (JobConstants.is幻影(job)) {
            if (skillid != 幻影.黑色秘卡 && skillid != 幻影.卡片雪舞) {
                player.handleCarteGain(moboid, false);
            }
        } else if (JobConstants.is隐月(job)) {
            Optional.ofNullable(SkillFactory.getSkill(隐月.精灵凝聚第1招)).ifPresent(skill -> {
                if (player.getTotalSkillLevel(skill) > 0) {
                    MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(skill));
                    if (totDamage > 0) {
                        player.addHP(((int) Math.min(maxhp, Math.min(((int) ((double) totDamage * (double) effect.getX() / 100.0)), stats.getMaxHp() / 2))));
                    }
                }
            });
        } else if (JobConstants.is尖兵(job)) {
            player.addPowerCount(1); //打怪必须是开启后才能获得能量
            if (monster.isAlive() && monster.getTriangulation() >= 3 && monster.isBuffed(MonsterStatus.MOB_STAT_Explosion)) {
                monster.setTriangulation(0);
                monster.cancelStatus(MonsterStatus.MOB_STAT_Explosion);
                monster.cancelStatus(MonsterStatus.MOB_STAT_EVA);
                monster.cancelStatus(MonsterStatus.MOB_STAT_Blind);
                player.send(ForcePacket.UserExplosionAttack(monster));
                return;
            }
            if (player.getSkillLevel(尖兵.三角进攻) > 0 && monster.isAlive()) {
                Optional.ofNullable(SkillFactory.getSkill(尖兵.三角进攻)).ifPresent(skill -> {
                    MapleStatEffect effect = skill.getEffect(player.getSkillLevel(skill));
                    if (player.getLastComboTime() + (long) (effect.getY() * 1000) < System.currentTimeMillis()) {
                        monster.setTriangulation(0);
                    }
                    if (effect.makeChanceResult()) {
                        player.setLastComboTime(System.currentTimeMillis());
                        if (monster.getTriangulation() < 3) {
                            monster.setTriangulation(monster.getTriangulation() + 1);
                            ArrayList<MonsterStatusEffect> monsterStatusEffects = new ArrayList<>();
                            monsterStatusEffects.add(new MonsterStatusEffect(MonsterStatus.MOB_STAT_EVA, (-monster.getTriangulation()) * effect.getX(), effect.getSourceid(), null, false));
                            monsterStatusEffects.add(new MonsterStatusEffect(MonsterStatus.MOB_STAT_Blind, monster.getTriangulation() * effect.getX(), effect.getSourceid(), null, false));
                            monsterStatusEffects.add(new MonsterStatusEffect(MonsterStatus.MOB_STAT_Explosion, monster.getTriangulation(), effect.getSourceid(), null, false));
                            monster.applyStatus(player, monsterStatusEffects, false, (long) (effect.getY() * 1000), true, effect);
                        }
                    }
                });
            }
        } else if (JobConstants.is恶魔复仇者(job)) {
            if (totDamage > 0) {
                Optional.ofNullable(SkillFactory.getSkill(恶魔复仇者.生命吸收)).ifPresent(skill -> {
                    int skillLevel = player.getTotalSkillLevel(skill);
                    if (skillLevel > 0) {
                        MapleStatEffect effect = skill.getEffect(skillLevel);
                        if (effect != null && effect.makeChanceResult()) {
                            int hpheal = (int) (stats.getCurrentMaxHp() * (effect.getX() / 100.0));
                            if (player.isShowPacket()) {
                                player.dropDebugMessage(1, "[恶魔复仇者] 攻击恢复Hp " + hpheal);
                            }
                            player.addHP(hpheal);
                        }
                    }
                });
            }
        } else if (JobConstants.is唤灵斗师(job)) {
            player.handleDeathPact(moboid, true);
        } else if (JobConstants.is神射手(job)) {
            if (skillid != 神射手.箭矢炮盘_攻击) {
                //50% 的概率吸血 20%
                if (player.getBuffedValue(MapleBuffStat.三彩箭矢) != null && specialStats.getArrowsMode() == 0 && Randomizer.nextInt(100) <= 50) {
                    if (totDamage > 0) {
                        player.addHP(((int) Math.min(maxhp, Math.min(((int) ((double) totDamage * (double) 20 / 100.0)), stats.getMaxHp() / 2))));
                    }
                }
                player.handleArrowsCharge(moboid);
            }
        } else if (JobConstants.is超能力者(player.getJob())) {
            if (SkillConstants.isKSTelekinesisSkill(skillid)) {
                player.handlerKSTelekinesis(moboid);
            }
        } else if (JobConstants.is奇袭者(player.getJob())) {
            player.handle元素雷电(skillid);
//            player.handleHeartMineUnity();
        } else if (JobConstants.is圣骑士(player.getJob())) {
            player.handle元素冲击(skillid);
        } else if (JobConstants.is风灵使者(player.getJob())) {
            if (skillid != 风灵使者.狂风肆虐Ⅰ && skillid != 风灵使者.狂风肆虐Ⅱ && skillid != 风灵使者.狂风肆虐Ⅲ) {
                //player.handle狂风肆虐();
                player.handle暴风灭世(monster.getObjectId());
            }
        } else if (skillid == 爆莉萌天使.灵魂吸取_攻击) {
            player.handle灵魂吸取(monster.getObjectId());
        }

        //------------------------------------------------- 针对技能控制
        //
        //
        if (skillid > 0) {
            Optional.ofNullable(SkillFactory.getSkill(skillid)).ifPresent(skil -> {
                MapleStatEffect effect = skil.getEffect(player.getTotalSkillLevel(skil));
                switch (skillid) {
                    case 1078: //伊卡尔特的吸血 - 伊卡尔特召唤吸血鬼后，对多个敌人造成4连击，并吸收部分伤害恢复HP。一次不可吸收超过角色最大HP1/2以上，也不可超过怪物的最大HP。特定等级提升时，技能等级可以提升1。
                    case 恶魔猎手.血腥渡鸦:
                    case 豹弩游侠.利爪狂风: {
                        if (totDamage > 0) {
                            player.addHP(((int) Math.min(maxhp, Math.min(((int) ((double) totDamage * (double) effect.getX() / 100.0)), stats.getMaxHp() / 2))));
                        }
                        break;
                    }
                    case 船长.无尽追击: {
                        player.setLinkMid(moboid, effect.getX());
                        break;
                    }
                    case 双刀.流云斩:
                    case 双刀.双刀风暴:
                    case 双刀.血雨腥风:
                    case 双刀.悬浮地刺:
                    case 双刀.暗影飞跃斩:
                    case 双刀.终极斩:
                    case 双刀.暴怒刀阵:
                    case 双刀.地狱锁链:
                    case 双刀.幽灵一击:
                    case 飞侠.二连击:
                    case 飞侠.双飞斩:
                    case 侠盗.回旋斩:
                    case 侠盗.炼狱:
                    case 侠盗.刀刃之舞:
                    case 侠盗.暗杀:
                    case 侠盗.一出双击:
                    case 侠盗.突然袭击:
                    case 隐士.爆裂飞镖:
                    case 隐士.风之护符:
                    case 隐士.三连环光击破:
                    case 隐士.影子分裂:
                    case 隐士.四连镖:
                    case 夜行者.武器用毒液:
                    case 夜行者.多重飞镖:
                    case 夜行者.四连射: {
                        int[] skills = {侠盗.武器用毒液, 隐士.武器用毒液, 双刀.武器用毒液};
                        int[] skillss = {侠盗.致命毒液, 隐士.致命毒液, 双刀.致命毒液};
                        int skillS = 0;
                        for (int i : skillss) {
                            if (player.getTotalSkillLevel(i) > 0) {
                                skillS = i;
                                break;
                            }
                        }
                        for (int i : skills) {
                            int finalSkillS = skillS;
                            Skill skill = SkillFactory.getSkill(i);
                            if (player.getTotalSkillLevel(skill) > 0) {
                                MapleStatEffect venomEffect = skill.getEffect(player.getTotalSkillLevel(skill));
                                if (player.getTotalSkillLevel(finalSkillS) > 0) {//致命毒液
                                    Optional.ofNullable(SkillFactory.getSkill(finalSkillS)).ifPresent(skill1 -> {
                                        MapleStatEffect effect1 = skill1.getEffect(player.getTotalSkillLevel(skill1));
                                        int szie = 0;
                                        for (MonsterStatusEffect s : monster.getAllBuffs()) {
                                            if (s.getSkill() == finalSkillS) {
                                                szie++;
                                            }
                                        }

                                        if (effect1.makeChanceResult()) {
                                            if (szie < effect1.getDOTStack() + 1) {
                                                monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Poison, effect1.getDOT(), finalSkillS, null, false), true, effect1.getDuration(), true, effect1);
                                            }
                                        }
                                    });
                                } else {
                                    if (venomEffect.makeChanceResult()) {
                                        monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Poison, 1, i, null, false), true, venomEffect.getDuration(), true, venomEffect);
                                    }
                                }
                                break;
                            }
                        }
                        break;
                    }
                    case 侠盗.神通术: { // 神通术
                        monster.handleSteal(player);
                        break;
                    }
                    case 夜行者.双飞斩:
                    case 夜行者.三连环光击破:
                    case 夜行者.三连环光击破_最后一击:
                    case 夜行者.四连镖:
                    case 夜行者.四连镖_最后一击:
                    case 夜行者.五倍投掷:
                    case 夜行者.五倍投掷_最后一击: {
                        if (player.getBuffedValue(MapleBuffStat.元素黑暗) != null) {
                            MapleStatEffect eff = player.getStatForBuff(MapleBuffStat.元素黑暗);
                            monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_ElementDarkness, 1, 夜行者.元素_黑暗, null, false, 0), true, eff.getDuration(), true, eff);
                        }
                        break;
                    }
                    case 冰雷.冰河锁链:
                        monster.setTempEffectiveness(Element.冰, effect.getDuration());
                        break;
                    case 火毒.迷雾爆发:
                        monster.setTempEffectiveness(Element.火, effect.getDuration());
                        break;
                }
            });
        }

        //------------------------------------------------- 针对状态控制
        //
        //
        if (player.getBuffedValue(MapleBuffStat.额外回避) != null) {
            MapleStatEffect eff = player.getStatForBuff(MapleBuffStat.额外回避);
            if ((eff != null) && (eff.makeChanceResult())) {
                monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Speed, eff.getX(), 3121007, null, false, 0), false, eff.getY() * 1000, true, eff);
            }
        } else if (player.getJob() == MapleJob.骑士.getId() || player.getJob() == MapleJob.圣骑士.getId()) {
            Skill skill = SkillFactory.getSkill(圣骑士.寒冰冲击);
            if (player.isBuffFrom(MapleBuffStat.属性攻击, skill)) {
                MapleStatEffect eff = skill.getEffect(player.getTotalSkillLevel(skill));
                MonsterStatusEffect monsterStatusEffect = new MonsterStatusEffect(MonsterStatus.MOB_STAT_Freeze, 1, skill.getId(), null, false, 0);
                monster.applyStatus(player, monsterStatusEffect, false, eff.getY() * 2000, true, eff);
            }
        } else if (JobConstants.is战神(player.getJob())) {
            if (player.getBuffedValue(MapleBuffStat.属性攻击) != null && !monster.getStats().isBoss()) {
                MapleStatEffect eff = player.getStatForBuff(MapleBuffStat.属性攻击);
                if (eff != null) {
                    monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Speed, eff.getX(), eff.getSourceid(), null, false, 0), false, eff.getY() * 1000, true, eff);
                }
            }
        } else if (player.getBuffedValue(MapleBuffStat.缓速术) != null) {
            MapleStatEffect eff = player.getStatForBuff(MapleBuffStat.缓速术);
            if (eff != null && eff.makeChanceResult() && !monster.isBuffed(MonsterStatus.MOB_STAT_Speed)) {
                monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Speed, eff.getX(), eff.getSourceid(), null, false, 0), false, eff.getY() * 1000, true, eff);
            }
        }else if (player.getBuffedValue(MapleBuffStat.炎术引燃) != null) {
            MapleStatEffect eff = player.getStatForBuff(MapleBuffStat.炎术引燃);
            if (eff != null && eff.makeChanceResult() && !monster.isBuffed(MonsterStatus.MOB_STAT_Poison)) {
                monster.applyStatus(player, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Poison, 1, eff.getSourceid(), null, false, 0), true, eff.getDOTTime(), true, eff);
            }
        }
    }


    @Override
    public void afterAttackHandler(MapleCharacter player, int mobCount, int skillid, boolean isCritDamage) {
        final PlayerSpecialStats specialStats = player.getSpecialStat();
        int job = player.getJob();
        // 控制职业
        switch (job) {
            case MapleJobCode.主教:
                // 消耗魔量26，最多以80%的伤害攻击6个敌人7次，或者使包括自己在内的队员恢复最大血量的10%。
                if (skillid == 主教.光芒飞箭 && player.getParty() != null) {
                    for (MaplePartyCharacter pc : player.getParty().getMembers()) {
                        if (pc != null && pc.getMapid() == player.getMapId() && pc.getChannel() == player.getClient().getChannel()) {
                            MapleCharacter other = player.getClient().getChannelServer().getPlayerStorage().getCharacterByName(pc.getName());
                            if (other != null) {
                                other.addHP((int) (player.getStat().getCurrentMaxHp() * SkillFactory.getSkill(主教.光芒飞箭).getEffect(player.getSkillLevel(主教.光芒飞箭)).getX() / 100.0D * 10));
                            }
                        }
                    }
                }
                //消耗MP500，以1000%的伤害最多对15个敌人造成8次攻击。同时向周围队员发放无视一次HP变成0的增益。
                //冷却时间90秒
                //获得增益的队员在600秒内不会再次获得天堂之门的增益。
                else if (skillid == 主教.天堂之门) {
                    MapleStatEffect tmpEffect = SkillFactory.getSkill(主教.天堂之门).getEffect(player.getSkillLevel(主教.天堂之门));
                    tmpEffect.applyTo(player);
                }
                break;
            case MapleJobCode.侠盗: {
                //处理激活刀飞幸运钱的再次使用
                if (isCritDamage && player.getSkillLevel(侠盗.幸运钱) > 0) {
                    player.switchLuckyMoney(true);
                }
            }
            case MapleJobCode.拳手:
            case MapleJobCode.斗士:
            case MapleJobCode.冲锋队长:
                if (!specialStats.isEnergyFull()) {
                    player.handleEnergyCharge(mobCount * 2);
                } else {
                    player.handleEnergyConsume(mobCount, skillid);
                }
                break;
            case MapleJobCode.剑客:
            case MapleJobCode.勇士:
            case MapleJobCode.英雄:
            case MapleJobCode.幻影3转: //添加幻影职业 幻影复制技能后有这个
            case MapleJobCode.幻影4转: //添加幻影职业 幻影复制技能后有这个
                if (skillid != 英雄.虎咆哮 && player.getBuffedValue(MapleBuffStat.斗气集中) != null) {
                    player.handleOrbgain(false);
                }
                break;
            case MapleJobCode.狂龙战士1转:
            case MapleJobCode.狂龙战士2转:
            case MapleJobCode.狂龙战士3转:
            case MapleJobCode.狂龙战士4转:
                int amon = 0;
                switch (skillid) {
                    case 狂龙战士.扇击:
                    case 狂龙战士.扇击_变身:
                        amon = 1;
                        break;
                    case 狂龙战士.飞龙斩_2:
                    case 狂龙战士.烈火箭:
                        amon = 2;
                        break;
                    case 狂龙战士.冲击波:
                    case 狂龙战士.穿刺冲击:
                        amon = 3;
                        break;
                    case 狂龙战士.牵引锁链:
                    case 狂龙战士.怒雷屠龙斩:
                    case 狂龙战士.天空剑影:
                    case 狂龙战士.剑气突袭:
                        amon = 5;
                        break;
                    case 狂龙战士.剑刃之壁:
                    case 狂龙战士.进阶剑刃之壁:
                        amon = 20;
                        break;
                    case 狂龙战士.恶魔之息:
                        amon = 40;
                        break;
                }
                if (amon > 0) {
                    player.handleMorphCharge(amon);
                }
                break;
            case MapleJobCode.神射手: {
                if (player.getBuffSource(MapleBuffStat.SECONDARY_STAT_IndieQrPointTerm) == 神射手.箭雨) {
                    Optional.ofNullable(SkillFactory.getSkill(神射手.箭雨)).ifPresent(skill -> {
                        int totalSkillLevel = player.getTotalSkillLevel(神射手.箭雨);
                        MapleStatEffect effect = skill.getEffect(totalSkillLevel);
                        if (totalSkillLevel > 0 && effect != null && JobConstants.is神射手(skillid / 10000) && System.currentTimeMillis() >= player.getLastUseVSkillTime()) {
                            player.setLastUseVSkillTime(System.currentTimeMillis() + (long) (effect.getX() * 1000));
                            player.send(MaplePacketCreator.userBonusAttackRequest(神射手.箭雨_1, 0, Collections.emptyList()));
                        }
                    });
                }
                break;
            }
            case MapleJobCode.魂骑士4转: {
                if (player.getBuffSource(MapleBuffStat.SECONDARY_STAT_IndieQrPointTerm) == 魂骑士.天人之舞) {
                    Optional.ofNullable(SkillFactory.getSkill(魂骑士.天人之舞)).ifPresent(skill -> {
                        int totalSkillLevel = player.getTotalSkillLevel(魂骑士.天人之舞);
                        MapleStatEffect effect = skill.getEffect(totalSkillLevel);
                        int value = player.getBuffedIntValue(MapleBuffStat.月光转换);
                        if (totalSkillLevel > 0 && effect != null && JobConstants.is魂骑士(skillid / 10000) && System.currentTimeMillis() >= player.getLastUseVSkillTime()) {
                            player.setLastUseVSkillTime(System.currentTimeMillis() + (long) (effect.getX() * 1000));
                            player.send(MaplePacketCreator.userBonusAttackRequest(value == 1 ? 魂骑士.天人之舞_1 : 魂骑士.天人之舞_2, 0, Collections.emptyList()));
                        }
                    });
                }
                break;
            }
            case MapleJobCode.战神4转: {
                if (player.getBuffSource(MapleBuffStat.SECONDARY_STAT_IndieQrPointTerm) == 战神.装备摩诃) {
                    Optional.ofNullable(SkillFactory.getSkill(战神.装备摩诃)).ifPresent(skill -> {
                        int totalSkillLevel = player.getTotalSkillLevel(战神.装备摩诃);
                        MapleStatEffect effect = skill.getEffect(totalSkillLevel);
                        if (totalSkillLevel > 0 && effect != null && JobConstants.is战神(skillid / 10000) && System.currentTimeMillis() >= player.getLastUseVSkillTime()) {
                            player.setLastUseVSkillTime(System.currentTimeMillis() + (long) (effect.getX() * 1000));
                            player.send(MaplePacketCreator.userBonusAttackRequest(战神.装备摩诃_1, 0, Collections.emptyList()));
                        }
                    });
                }
                break;
            }
            case MapleJobCode.双弩精灵4转: {
                if (player.getBuffSource(MapleBuffStat.SECONDARY_STAT_IndieQrPointTerm) == 双弩.精灵元素) {
                    Optional.ofNullable(SkillFactory.getSkill(双弩.元素幽灵_3)).ifPresent(skill -> {
                        int totalSkillLevel = player.getTotalSkillLevel(双弩.精灵元素);
                        MapleStatEffect effect = skill.getEffect(totalSkillLevel);
                        if (totalSkillLevel > 0 && effect != null && JobConstants.is双弩精灵(skillid / 10000) && System.currentTimeMillis() >= player.getLastUseVSkillTime()) {
                            player.setLastUseVSkillTime(System.currentTimeMillis() + (long) (effect.getX() * 1000));
                            player.send(MaplePacketCreator.userBonusAttackRequest(双弩.元素幽灵_3, 0, Collections.emptyList()));
                        }
                    });
                }
                break;
            }
            case MapleJobCode.爆莉萌天使1转:
            case MapleJobCode.爆莉萌天使2转:
            case MapleJobCode.爆莉萌天使3转:
            case MapleJobCode.爆莉萌天使4转: {
//                ArrayList<Integer> monsterids = new ArrayList<>();
//                Skill skill = SkillFactory.getSkill(skillid);
//                MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(SkillConstants.getLinkedAttackSkill(skillid)));
//                if (skill != null && effect != null && skillid != 爆莉萌天使.灵魂吸取_攻击 && skillid != 爆莉萌天使.灵魂吸取专家_1 && l3 - player.getstifftime() > 1500 && player.getStatForBuff(MapleBuffStat.灵魂吸取专家) != null && (effect = player.getStatForBuff(MapleBuffStat.灵魂吸取专家)).lH()) {
//                    player.setstifftime(l3);
//                    List<MapleMapObject> monstersInRange = player.getMap().getMonstersInRange(player.getTruePosition(), 100000.0);
//                    if (!monstersInRange.isEmpty()) {
//                        monstersInRange.forEach(mapleMapObject -> {
//                            if (mapleMapObject != null && !((MapleMonster) mapleMapObject).getStats().isFriendly()) {
//                                monsterids.add(mapleMapObject.getObjectId());
//                            }
//                        });
//                        new MapleForce(player.getId(), skillid, 0, MapleForceType.)
//                        player.send_other(i.b.x.a(player, 0, monsterids, 1, effect.kA(), 爆莉萌天使.灵魂吸取专家_1, 300, false), true);
//                        player.sendEnableActions();
//                    }
//                }
//                MapleStatEffect statForBuff = player.getStatForBuff(MapleBuffStat.伤害置换);
//                if (statForBuff != null) {
//                    long l4 = (long) player.getBuffedValue(MapleBuffStat.伤害置换) + l2 * (long)statForBuff.getY() / 100;
//                    player.setBuffedValue(MapleBuffStat.伤害置换, (int)Math.min(Math.max(0, l4), (long)Math.min(99999, player.getStat().getMaxHp())));
//                    player.updateBuffEffect(statForBuff, Collections.singletonMap(MapleBuffStat.伤害置换, (int)l4));
//                }
                if (skillid == 爆莉萌天使.爱星能量) {
                    Skill skill;
                    MapleStatEffect effect;
                    if ((skill = SkillFactory.getSkill(爆莉萌天使.爱星能量)) != null
                            && (effect = skill.getEffect(player.getTotalSkillLevel(skill))) != null) {
                        player.cancelEffectFromBuffStat(MapleBuffStat.爱星能量);
                        player.handle无敌(effect, effect.getZ());
                    }
                }
                break;
            }
            case MapleJobCode.船长:
                Integer value = player.getBuffedValue(MapleBuffStat.神速衔接);
                if (value == null) {
                    int skilllevel = player.getTotalSkillLevel(船长.神速衔接);
                    Optional.ofNullable(SkillFactory.getSkill(船长.神速衔接)).ifPresent(skill -> {
                        MapleStatEffect effect = skill.getEffect(skilllevel);
                        if (Randomizer.nextInt(100) < effect.getProp()) {
                            effect.applyTo(player);
                        }
                    });
                } else if (value > 1) {
                    player.cancelBuffStats(MapleBuffStat.神速衔接);
                }
                break;
            case MapleJobCode.尖兵新手:
            case MapleJobCode.尖兵1转:
            case MapleJobCode.尖兵2转:
            case MapleJobCode.尖兵3转:
            case MapleJobCode.尖兵4转:
                if (player.getBuffedValue(MapleBuffStat.精准火箭) != null) {
                    player.handleCardStack(skillid);
                }
                break;
            case MapleJobCode.风灵使者1转:
            case MapleJobCode.风灵使者2转:
            case MapleJobCode.风灵使者3转:
            case MapleJobCode.风灵使者4转:
                if (player.getBuffedValue(MapleBuffStat.狂风肆虐) != null) {
                    player.handle狂风肆虐(skillid);
                }

                break;
            case MapleJobCode.夜光:
            case MapleJobCode.夜光1转:
            case MapleJobCode.夜光2转:
            case MapleJobCode.夜光3转:
            case MapleJobCode.夜光4转:
                player.handleLuminous(skillid); //夜光光暗点数处理
                if (player.getJob() == 2712) {
                    player.handleDarkCrescendo(); //夜光黑暗高潮处理
                }
                player.handleBlackBless(); //夜光黑暗祝福处理
                break;
            case MapleJobCode.恶魔复仇者1转:
            case MapleJobCode.恶魔复仇者2转:
            case MapleJobCode.恶魔复仇者3转:
            case MapleJobCode.恶魔复仇者4转:
                player.handle超越状态(skillid);
                break;
            case MapleJobCode.箭神:
                // 真狙击
                // 消耗魔量 1000，发射最多对12个敌人以980%的伤害造成14次爆击攻击的箭矢，最多发射6次
                //越是接近瞄准镜中央，伤害即会提高15%，最多提高100%，额外无视100%怪物防御率
                //最多可在12秒内瞄准，在该时间内，以及在技能结束后的2秒内无敌
                //冷却时间 180秒
                if (skillid == 箭神.真一击要害箭 && JobConstants.is箭神(player.getJob()) && player.getBuffSource(MapleBuffStat.SECONDARY_STAT_CursorSniping) == 箭神.真狙击) {
                    int maxValue = Math.max(0, player.getBuffedIntValue(MapleBuffStat.SECONDARY_STAT_CursorSniping) - 1);
                    if (maxValue > 0) {
                        player.setBuffedValue(MapleBuffStat.SECONDARY_STAT_CursorSniping, maxValue);
                        player.updateBuffEffect(player.getStatForBuff(MapleBuffStat.SECONDARY_STAT_CursorSniping), Collections.singletonMap(MapleBuffStat.SECONDARY_STAT_CursorSniping, maxValue));
                    } else {
                        Optional.ofNullable(SkillFactory.getSkill(箭神.真狙击)).ifPresent(skill -> {
                            MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(箭神.真狙击));
                            player.cancelEffectFromBuffStat(MapleBuffStat.SECONDARY_STAT_CursorSniping);
                            player.handle无敌(effect, 2000);
                        });
                    }
                }
                break;
            default:
                if (!player.isIntern()) {
                    player.cancelEffectFromBuffStat(MapleBuffStat.潜入状态);
                    MapleStatEffect ds = player.getStatForBuff(MapleBuffStat.隐身术);
                    if (ds != null) {
                        if (ds.getSourceid() != 双刀.进阶隐身术 || !ds.makeChanceResult()) {
                            player.cancelEffectFromBuffStat(MapleBuffStat.隐身术);
                        }
                    }
                }
        }

        // 控制职业群
        if (JobConstants.is战士(player.getJob()) && player.getBuffedIntValue(MapleBuffStat.SECONDARY_STAT_IndieQrPointTerm) > 0 && player.getBuffSource(MapleBuffStat.SECONDARY_STAT_IndieQrPointTerm) == 战士.灵气武器) {
            Optional.ofNullable(SkillFactory.getSkill(战士.灵气武器)).ifPresent(skill -> {
                int totalSkillLevel = player.getTotalSkillLevel(战士.灵气武器);
                MapleStatEffect effect = skill.getEffect(totalSkillLevel);
                if (totalSkillLevel > 0 && effect != null && System.currentTimeMillis() >= player.getLastUseVSkillTime()) {
                    player.setLastUseVSkillTime(System.currentTimeMillis() + (long) (effect.getZ() * 1000));
                    player.send(MaplePacketCreator.userBonusAttackRequest(战士.灵气武器_1, 0, Collections.emptyList()));
                }
            });
        }

    }
}
